# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
  # Constructs a table row from +header+ and +content+.
  def simple_tr(header, content)
    <<-EOS
      <tr>
        <th>#{header}</th>
        <td>#{content}</th>
      </tr>
    EOS
  end

  def horizontal_table(headings, contents)
    str = "<table>\n\t<tr>\n\t\t<th>" + headings.join("</th>\n\t\t<th>") + 
      "</th>\n\t</tr>\n"
    str += "\t<tr>\n\t\t<td>" + contents.join("</td>\n\t\t<td>") + "</td>\n\t</tr>\n"
    str
  end
end
